package com.appleyk.service.imp;

import com.appleyk.node.Tuser;
import com.appleyk.repository.TuserRepository;
import com.appleyk.service.TuserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TuserServiceImp  implements TuserService {

    @Autowired
    private TuserRepository TuserRepository;


    public String updeta(Long id,Long uid, String pinjia) {

        if(id==uid){
            return "无法对自己修改";
        }

        Tuser tuser=TuserRepository.setTuser(uid,pinjia);

        System.out.println(tuser.toString());

        /**
         * 当返回对象不为null 可以插入
         */
        if(tuser==null){
            return  "失败";
        }

        return "成功";
    }
}
